// 弹出层组件
import React from 'react';
import { Button, Modal } from 'antd';
import Register from '../register/register';

class PopupRegister extends React.Component {
  state = {
    visible: false,
    width: 360,
    bodyStyle: 
      {
        paddingLeft: 0,
        paddingRight: 34, 
        paddingBottom: 15
     }
  }
  showModal = () => {
    this.setState({
      visible: true,
    });
  }
  handleCancel = () => {
    this.setState({ visible: false });
  }
  render() {
    const { visible } = this.state;
    return (
      <div>
        <Button type="default" onClick={this.showModal}>
          注册
        </Button>
        <Modal
          visible={visible}
          width={this.state.width}
          bodyStyle={this.state.bodyStyle}
          title="注册" 
          onCancel={this.handleCancel}
          footer={null}
        >
        <Register />
        </Modal>
      </div>
    );
  }
}

export default PopupRegister;
